<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>index08-Symbol</title>
</head>
<body>
    <script type="text/javascript">

        // Symbol,唯一性的作用
        // let sb = Symbol();
        // console.log(sb);
        // console.log(typeof sb);
        // console.log(typeof(sb) === 'symbol');
        // let sb1 = Symbol();
        // let sb2 = Symbol();
        // console.log(sb1 == sb2);
        // let sb1 = Symbol("address");
        // let sb2 = Symbol("address");
        // console.log(sb1 == sb2);
        // let person = {
        //     name: '张三',
        //     age: 20
        // };
        // // person.address = '新街口';
        // // person.address = '夫子庙';
        // let address1 = Symbol('address');
        // let address2 = Symbol('address');
        // person[address1] = '新街口';
        // person[address2] = '夫子庙';
        // console.log(person);
        // const System_key=Symbol('114aaa');
        // console.log(System_key);
        // console.log(Symbol("aaa") === Symbol("aaa"));
        // console.log(Symbol.for("bbb") === Symbol.for('bbb'));
        let fooKey = Symbol.for('bar');
        console.log(fooKey);
        console.log(Symbol.keyFor(fooKey));
        
    </script>
</body>
</html>